﻿@{
    ViewBag.Title = "Create2";

}

<link href="../../Content/themes/bootstrap.extra.table.css" rel="stylesheet" />
@section Header{

    <script type="text/jscript">

        $(function () {

            $('#Formulario').change(function () {

                var data = {};
                data.grupo = $('#Grupo').val();
                data.formu = $('#Formulario').val();

                $.getJSON('/Perfiles/PermisosList/',data, function (data) {

                    var items = '<option>Selecciona Permiso</option>';

                    $.each(data, function (i, perm) {
                        items += "<option value='" + perm.Value + "'>" + perm.Text + "</option>";

                    });

                    $('#Permisos').html(items);

                });

            });

        });

</script>
}

<h2>Create2</h2>

@Html.ValidationSummary("Por favor modifique el error y cargue los campos requeridos.")
 
@using (Html.BeginForm())
{

    <fieldset>

        <legend>Crear Perfil</legend>
 
        
        <div class="clearfix">
            @Html.Label("Grupo")
        
            <div class="input">
            @Html.DropDownList("Grupo", ViewBag.IdGrupo as SelectList, "Selecciona Grupo", new { id = "Grupo" })
            @Html.ValidationMessage("CustomError", "*")
            </div>
        </div>
        
        <div class="clearfix">
            @Html.Label("Formulario")

            <div class="input">
            @Html.DropDownList("Formulario", ViewBag.IdFormulario as SelectList, "Selecciona Formulario", new { idform = "Formulario" })
            @Html.ValidationMessage("CustomError", "*")
            </div>
        </div>
        
        
        <div class="clearfix">
            @Html.Label("Permisos")

            <div class="input">
                <select id="Permisos" name="Permisos"></select>
                @Html.ValidationMessage("CustomError", "*")
            </div>
        </div>

        <div class="actions">
            <input type="submit" value="Guardar" id="SubmitId" class="btn" />
            @Html.ActionLink("Cancelar", "Index", null, new { @class = "btn"})
        </div>

    </fieldset>

}



